var Dragon = {
	elem : null,
	cx : 0, cy : 0,
	clearpx : function (stro){
		str=""+stro+"";
		return (str.replace("px",""))*1;
	},
	keys : function (e){
		if (e.keyCode==43){
			Dragon.elem.style.zIndex++;
		}else if (e.keyCode==45){
			Dragon.elem.style.zIndex--;
		}
	},
	dragmove : function (e){
		var obj=Dragon.elem;
		if(!obj)return;
		obj.style.top=(Dragon.clearpx(e.clientY)-Dragon.cy)+"px";
		obj.style.left=(Dragon.clearpx(e.clientX)-Dragon.cx)+"px";
		return false;
	},
	dragend : function (e){
		var obj=Dragon.elem;
		eventh.del(obj,"mouseup",Dragon.dragend);
		eventh.del(document,"mousemove",Dragon.dragmove);
		eventh.del(obj,"dragstart",Dragon.dragstart);
		eventh.del(document,"keypress",Dragon.keys);
		TimeShow.RPos(Dragon.elem);
		Dragon.elem=null;
		document.body.style.cursor="";
	},
	dragstart : function (e){
		var obj=Dragon.elem;
		document.body.style.cursor="move";
		eventh.handle(document,"mousemove",Dragon.dragmove);
		eventh.handle(obj,"mouseup",Dragon.dragend);
		eventh.handle(document,"keypress",Dragon.keys);
		return false;
	},
	draginit : function (e){
		var obj=(e.target)?e.target:e.srcElement;
		if (obj.tagName!="DIV")obj=(obj.parentElement)?obj.parentElement:obj.parentNode;
		if (obj.tagName!="DIV")return;
		Dragon.elem=obj;
		Dragon.cx=Dragon.clearpx(e.clientX)-Dragon.clearpx(obj.style.left);
		Dragon.cy=Dragon.clearpx(e.clientY)-Dragon.clearpx(obj.style.top);
		eventh.handle(obj,"dragstart",Dragon.dragstart);
	}
}
